package lab03.test08;

import java.io.*;

public class Test08 {
    public static void main(String[] args) {
        File myFile = new File("F:\\test03.txt");
        try {
            myFile.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        FileInputStream fileInputStream = null;
        FileOutputStream fileOutputStream = null;
        FileInputStream fileInput = null;
        try {
            fileInputStream = new FileInputStream("F:\\test01.txt");
            fileInput = new FileInputStream("F:\\test02.txt");
            fileOutputStream = new FileOutputStream("F:\\test03.txt");
            int a ;
            int b = 0;
            while ((a = fileInputStream.read()) != -1 || (b = fileInput.read()) != -1) {
                fileOutputStream.write(a);
                fileOutputStream.write(b);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}

